#ifndef PRRT_ITERATION_COUNT_H_
#define PRRT_ITERATION_COUNT_H_

#include "ompl/geometric/planners/rrt/pRRT.h"
#include "IIterationCount.h"

class pRRTIterationCount : public ompl::geometric::pRRT, public IIterationCount
{
public:
	pRRTIterationCount(const ompl::base::SpaceInformationPtr &si, int numThreads = 2);
	virtual ~pRRTIterationCount(void);

	virtual void clear(void);

	virtual ompl::base::PlannerStatus solve(const ompl::base::PlannerTerminationCondition &ptc);

protected:
	struct SolutionInfoIterationCount
	{
		Motion      *solution;
		Motion      *approxsol;
		double       approxdif;
		boost::mutex lock;
		std::vector<unsigned int> iterations;
	};

	void threadSolveIterationCount(unsigned int tid, const ompl::base::PlannerTerminationCondition &ptc, SolutionInfoIterationCount *sol);
};

#endif